<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8">
		<meta http-equiv="X-UA-Compatible" content="IE=edge">
		<title>登录</title>
		<!-- Tell the browser to be responsive to screen width -->
		<meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
		<!-- Bootstrap 3.3.5 -->
		<link rel="stylesheet" href="bootstrap/css/bootstrap.min.css">
		<!-- Font Awesome -->
		<link rel="stylesheet" href="//cdn.bootcss.com/font-awesome/4.5.0/css/font-awesome.css">
		<!-- Ionicons -->
		<!--<link rel="stylesheet" href="https://code.ionicframework.com/ionicons/2.0.1/css/ionicons.min.css">-->
		<!-- Theme style -->
		<link rel="stylesheet" href="css/AdminLTE.css">
		<!-- AdminLTE Skins. We have chosen the skin-blue for this starter
          page. However, you can choose any other skin. Make sure you
          apply the skin class to the body tag so the changes take effect.
    -->
		<link rel="stylesheet" href="css/skins/skin-blue.min.css">
		<link rel="stylesheet" type="text/css" href="css/ant-login.css" />

		<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
		<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
		<!--[if lt IE 9]>
        <script src="//cdn.bootcss.com/html5shiv/3.7.3/html5shiv.min.js"></script>
        <script src="//cdn.bootcss.com/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
	</head>

	<body>
		<!--<header class="navbar navbar-static-top navbar-default" role="banner">
			<div class="container">
				<div class="navbar-header">
					<a href="../" class="navbar-brand" ><img src="img/logo.png" width="240px"></a>
					
				</div>
				<nav class="" id="ant-nav">
					<h2>欢迎登录</h2>
				</nav>

			</div>
		</header>-->
		
		<div class="container ant-container">
			<div class="row">
				<div class="col-md-4 col-lg-offset-1 hidden-xs" style="color: #fff;">
					<img src="img/logo2.png" />
					<p style="font-size: 18px; line-height: 35px;">我们的成员散落全国各地，不需要固定办公室，只需要通过InterLaw就能保证畅快无碍的法案事件远程沟通协作。</p>
				</div>
				<div class="col-md-4 col-md-offset-1">
					<div class="box box-primary with-border ant-box">
						<div class="box-header padding20" style="padding-bottom: 0px;">
							<h3 class="box-title">全新体验</h3>
							<div class=" pull-right">
								<a href="registerJT.jsp" class="color-y">&gt;免费注册</a>
							</div>
						</div>
						<div class="box-body padding20">
							<form action="jumptocontain.action" name="form" method="post">
								<div class="form-group has-feedback">
									<label class="icon-user"><i class="fa fa-user fa-2x"></i></label>
		
									<input type="text" id="username" name="username" value="15763949907" class="form-control height50" placeholder="用户名/邮箱/手机号" onkeydown="if(event.keyCode==13){event.keyCode=0;return false;}" >
								</div>
								<div class="form-group has-feedback">
									<label class="icon-user"><i class="fa fa-lock fa-2x"></i></label>
						
									<input type="password" id="password" name="password" value="111" class="form-control height50" placeholder="密码" onkeydown="if(event.keyCode==13){document.getElementById('login').click();}">
									<font id="message" color="red"></font>
								</div>

								<div class="row">
									<!--<div class="">-->
										<div class="checkbox col-xs-6" style="margin-top: 0;">
											<label>
												<input type="checkbox"> 自动登录
											</label>
										</div>
										<!--<a href="#">忘记密码？</a>-->
										<!--<label for=""><input type="checkbox" name="" id=""  value=""/>自动登录</label>-->
									<!--</div>-->
									<div class="col-xs-6 text-right">
										<div class="form-group has-feedback">

											<a href="findpassword1.jsp" class="color-c">忘记密码？</a>
										</div>
									</div>
								</div>
								<div class="row">
									<div class="col-xs-12">
										<input type="button" id="login" class="btn btn-primary btn-block" style="height: 45px;" value="登录">
									</div>
									<!-- /.col -->
								</div>
							</form>
						</div>
					</div>
				</div>
			</div>
		</div>
		<!--<nav class=" navbar-fixed-bottom hidden-xs" style="  background: #2d3237;">
			<div class="container">
				<div class="row">
					<div class="col-md-6">
						<div class="row ant-footer">
							<div class="col-md-12" style="color: #fff;">
								<h3>
									InterLaw | <small>在线律师管理系统</small>            </h3>
							</div>
							<div class="col-md-12">
								<a href="#" target="_blank">关于我们</a>|
								<a href="#" target="_blank">隐私条款</a>|
								<a href="#" target="_blank">社区规范</a>|
								<a href="#" target="_blank">用户反馈</a>|
								<a href="#" target="_blank">加入我们</a>|
								<a href="#" target="_blank">版权声明</a>
								<br /> v
							</div>
						</div>
					</div>
					<div class="col-md-6">

					</div>

				</div>

			</div>
		</nav>-->
		<!--针对小屏幕显示-->
		<!--<div class="container visible-xs-inline-block">
			<div class="row">
				<div class="col-md-12">
					<a href="#" target="_blank">关于我们</a>|
					<a href="#" target="_blank">隐私条款</a>|
					<a href="#" target="_blank">社区规范</a>|
					<a href="#" target="_blank">用户反馈</a>|
					<a href="#" target="_blank">加入我们</a>|
					<a href="#" target="_blank">版权声明</a>
				</div>
			</div>
		</div>-->
		<!--针对小屏幕显示结束-->

		<!--<script src="jQuery/jQuery-2.1.4.min.js"></script>-->
		<script src="jQuery/jquery-1.11.2.min.js" type="text/javascript"></script>
		<!-- Bootstrap 3.3.5 -->
		<script src="bootstrap/js/bootstrap.min.js"></script>
  <script>
		var username;
		var password;
			function check(){
			//onclick="window.location.href='Register.jsp'"
				//alert("check");
				var frm = document.form;
				username = frm.username.value; //加载值
				password = frm.password.value;
				
				 var myreg = /^[a-zA-Z0-9_]{3,16}$/; //正则表达式 3-16
				if(!myreg.test(username)) //不匹配的情况
				{ 
		  		 //alert("用户名输入错误");
		  		 $("#message").text("用户名输入错误");
		  		 document.form.username.focus();
		   		 return false; 
				} 
			    else if(password==""||password==null){
				    //alert("登录密码不能为空!");
				    $("#message").text("登录密码不能为空!");
				    document.form.password.focus();
				    return false;
				}
					return true;
		}
        $(document).ready(function(){  //页面加载完成即执行
        $("#login").click(function(){//获取登录按钮响应JQuery
         //检验用户名格式以及密码是否为空
        
        if(check()){
        //
       // alert(username+password);
       // alert("ajax");
         $.ajax({  //提交ajax数据
type: "POST",
url:"login.action",	//把表单数据发送到ajax.jsp
dataType: "json", 
data:{
"username":username,
"password":password
},
async: true,
error: function(request) {
//alert("登录请求失败，请重试");
 $("#message").text("登录请求失败，请重试!");
},
success: function(data) {
var json = eval("(" + data + ")"); //获得json数据返回
if(json.code=="true"){ //判断是否验证成功
document.form.submit();
}else if(json.code=="false"){
	$("#message").text("密码错误，请重新输入");
	//alert("密码错误，请重新输入");//验证错误
}
else{
	$("#message").text("账户不存在,请检查账户名");
	//alert("账户不存在,请检查账户名");//验证错误
}
}
}); 
}
});       
});     
  </script >
	</body>

</html>